package com.lgx.group.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/basic")
public class BasicController {

	@RequestMapping("/head.ftl")
	public String head(HttpServletRequest request,HttpServletResponse response){
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://"
				+ request.getServerName() + ":" + request.getServerPort()
				+ path + "/";
		
		request.setAttribute("basePath", basePath);
		
		String nav = request.getParameter("nav");
		request.setAttribute("nav", nav);
		
		return "basic/head";
	}
	
	@RequestMapping("/foot.ftl")
	public String foot(HttpServletRequest request,HttpServletResponse response){
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://"
				+ request.getServerName() + ":" + request.getServerPort()
				+ path + "/";
		
		request.setAttribute("basePath", basePath);
		
		return "basic/foot";
	}
}
